<template>
	<div class="app">
		<h2>当前计数: {{ $store.state.counter }}</h2>
		<h2>name: {{ $store.state.name }}</h2>
		<button @click="actionBtnClick">+1</button>
		<button @click="changeNameFn">修改name</button>
	</div>
</template>

<script>
	export default {
		methods: {
			actionBtnClick() {
				this.$store.dispatch('incrementAction')
			},
			changeNameFn() {
				this.$store.dispatch('changeNameAction', 'kobe')
			},
		},
	}
</script>

<script setup></script>

<style scoped></style>
